#ifndef CONTEXTIMPL_H
#define CONTEXTIMPL_H

#include <defs/global.h>
#include <extensions/context.h>

namespace Optra { namespace Extensions {
        class ZoneInterface;
        class MainWindow;
        class Plugin;
    }}



O_PRIVATE_DECLARE(ContextImpl);
class ContextImpl : public Optra::Extensions::Context {
    Q_OBJECT
public:
    ContextImpl(const QDir& baseDir);
    ContextImpl(Opl::Core::EntityObject *parent = 0);
    ContextImpl(Optra::Extensions::ZoneInterface* inf, Opl::Core::EntityObject *parent);
	~ContextImpl();

	Opl::Scripting::ScriptEnvironment* scripts();
	void registerWindow(Optra::Extensions::MainWindow* wnd);

	void process(const QDir& root, bool createIfNeeded = false);

	bool start(Opl::Core::Task* task, QString name = QString());
	bool start(Opl::Core::Task* task, bool autodelete, QString name = QString());

	Optra::Extensions::Plugin* loadPlugin(const QString file);
private:
	O_PRIVATE_DECLARE_MEMBER(ContextImpl)
};
QML_DECLARE_TYPE(ContextImpl)
#endif // CONTEXTIMPL_H

